package com.ikangtai.shecare.personal;

import android.app.AlertDialog;
import android.app.DatePickerDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.util.Base64;
import android.view.View;
import android.widget.DatePicker;
import android.widget.TextView;
import android.widget.Toast;

import com.ikangtai.shecare.R;
import com.ikangtai.shecare.common.App;
import com.ikangtai.shecare.common.BaseActivity;
import com.ikangtai.shecare.common.baseView.ListBar;
import com.ikangtai.shecare.common.baseView.TopBar;
import com.ikangtai.shecare.common.db.DBManager;
import com.ikangtai.shecare.common.eventBusMsg.MyInfo;
import com.ikangtai.shecare.common.eventBusMsg.UserInfo;
import com.ikangtai.shecare.common.util.ActivityCollector;
import com.ikangtai.shecare.common.util.AppLog;
import com.ikangtai.shecare.common.util.AvatarImageMsg;
import com.ikangtai.shecare.common.util.DateUtil;
import com.ikangtai.shecare.common.util.OKHttpUtil;
import com.ikangtai.shecare.common.util.SelfPermissionUtil;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;

import org.json.JSONException;
import org.json.JSONObject;
import org.simple.eventbus.EventBus;
import org.simple.eventbus.Subcriber;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Calendar;
import java.util.Date;

public class JPMsgActivity extends BaseActivity implements View.OnClickListener {

    private TopBar topBar;
    private DBManager dbManager;
    private TextView titleTextView;
    private TextView contentTextView;
    private String title;
    private String content;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_personal_jpush);
        ActivityCollector.addActivity(this);
        EventBus.getDefault().register(this);
        dbManager = new DBManager(this);
        initView();
    }

    private void initView() {
        topBar = (TopBar) findViewById(R.id.topBar);
        topBar.setOnTopBarClickListener(new TopBar.OnTopBarClickListener() {
            @Override
            public void leftClick() {
                finish();
            }

            @Override
            public void midLeftClick() {

            }

            @Override
            public void midRightClick() {

            }

            @Override
            public void rightClick() {

            }
        });

        titleTextView = (TextView) findViewById(R.id.pushMsgTitle);
        contentTextView = (TextView) findViewById(R.id.pushMsgContent);

        Intent getPushmsg = getIntent();
        title = getPushmsg.getStringExtra("title");
        content = getPushmsg.getStringExtra("content");

        titleTextView.setText(title);
        contentTextView.setText(content);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
//            case R.id.nickName:
//                Intent nickNameIntent = new Intent(this, NickNameActivity.class);
//                startActivity(nickNameIntent);
//                break;
        }
    }



    @Override
    protected void onDestroy() {
        EventBus.getDefault().unregister(this);
        ActivityCollector.removeActivity(this);
        super.onDestroy();
    }
}
